package com.tom.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * All rights Reserved, Designed By www.tom.com
 *
 * @Author 徐望成
 * @Date 2023/6/30 16:15
 * @PackageName:com.tom.elasticsearchserver.utils
 * @ClassName: DateUtil
 * @Description: TODO
 * @Copyright: 2019 www.tomonline-inc.com Inc. All rights reserved.
 * 注意：本内容仅限于TOM集团内部传阅，禁止外泄以及用于其他的商业目
 * @Version 1.0
 */
public class DateUtil {

    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String timeConvertToString(Date date) {
        if (date == null) {
            return null;
        }
        String format = DATE_FORMAT.format(date);
        return format;
    }

    public static Date longToDate(long time) {
        return new Date(time);
    }
}
